const {getMusicHttp}=require('../../utils/P-music')
Page({
    data: {
        musics:[],
        offset:0
    },
    onLoad: function (options) {
        console.log(options)
        var offset=this.data.offset;
        getMusicHttp(offset).then(res=>{
            var musics=res.data.playlists;
            this.setData({
                musics
            })
        })
    },
    onReachBottom(){
        console.log("bottom")
        var offset=this.data.offset;
        offset+=20;
        getMusicHttp(offset).then(res=>{
            var musics=res.data.playlists;
            musics.push(...res.data.playlists);
            this.setData({
                musics,
                offset
            })
        })

    }

   
})